<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>地图定位</title>
    <style type="text/css">
        * {
            margin: 0px;
            padding: 0px;
        }
        body, button, input, select, textarea {
            font: 12px/16px Verdana, Helvetica, Arial, sans-serif;
        }
        li {
            margin-left: 30px;
        }
        #container {
            min-width:603px;
            min-height:767px;
        }
    </style>
    <script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp&key=H6IBZ-WLBC6-GLRSP-EG5R3-JOO3V-NZB2P"></script>
    <script>
        var map = null;
        var searchService = null;

        var init = function () {
            var center = new qq.maps.LatLng(39.916527, 116.397128);
            map = new qq.maps.Map(document.getElementById('container'), {
                center:center,
                zoomLevel:13
            });
            //调用Poi检索类
            searchService = new qq.maps.SearchService({
                panel:document.getElementById('infoDiv'),
                map : map
            });
            getResult();
        }
        function getResult() {

            //设置searchRequest
            var poiText = document.getElementById("poiText").value;
            var regionText = document.getElementById("regionText").value;

            searchService.setLocation(regionText);

            searchService.search(poiText);

        }

    </script>
</head>
<body onload="init()">
<div id="container"></div>
<div>城市名字<input type='text' name="city" th:value="${userDO.city}" id="regionText"/>
     详细地址<input type='text' name="company" th:value="${userDO.liveAddress}" id="poiText"/>
    <input type="button" value="Search" onclick="getResult()"/>

    <div id="pageIndexLabel" style="width: 100px;"></div>
</div>
<div style='width: 500px; height: 180px' id="infoDiv"></div>
</body>
</html>
